﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DispatchEdit.aspx.cs" Inherits="DuJianliang.ApplicationPlatform.Proj5715.Process.DispatchEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">    
    <title></title>
    <script defer="defer" src="../../Scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script type="text/javascript">
        function showPage(url, width, height) {
            window.showModalDialog(encodeURI(url), "", "dialogWidth=" + width + ";dialogHeight=" + height);
        }
    </script> 
    <style type="text/css">
	#editform {
		
		background-color:#FFFFFF;
	}

	#editform td {
		background-color:#F9F9F9;
	}

	#editform .editform_header {
		height:30px;
		text-align:center;
		background-color:#DFE8F6;
	}
	#editform .editform_itemtitle {
		height:30px;
		text-align:center;
		background-color:#F3F3F3;
	}

	#editform .editform_label {
		height:30px;
		width:100px;
		text-align:right;
		padding-right:10px;
		background-color:#F5F5F5;
	}

	#editform .editform_required_true, .editform_required_false {
		width:5px;
	}
	
	#editform .editform_required_true {
		background-color:Pink;
	}
	
	#editform .editform_required_false {
		background-color:Green;
	}
	
	#editform .editform_control 
	{
	    text-align:left;
		padding-top:5px;
		padding-bottom:5px;
		padding-left:6px;	
		width:400px;	
	}
	
	#editform .editform_control input, textarea {
		width:70%;
	}
	#editform select {
		width:70%;
	}
</style>
</head>
<body style="margin:0px; font-size:12px;">
<form id="form1" runat="server">
<div align="center" style="font-size:12px;">
<table id="editform" border="0" cellpadding="0" cellspacing="1">
	<tr>
		<td class="editform_header" colspan="6">派工单</td>		
	</tr>
	<tr>
		<td class="editform_label">派工单号</td>
		<td class="editform_required_true"></td>
		<td class="editform_control">
            <asp:TextBox ID="txtDispatchCode" runat="server"></asp:TextBox>
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" Display="Dynamic" 
                    ControlToValidate="txtDispatchCode" ForeColor="Red">必须填写</asp:RequiredFieldValidator>
        </td>
		<td class="editform_label">派工单状态</td>
		<td class="editform_required_false"></td>
		<td class="editform_control">
            <asp:TextBox ID="txtDispatchState" runat="server" Enabled="false"></asp:TextBox>
        </td>
	</tr>
	<tr>
		<td class="editform_label" style="height: 30px">修理等级</td>
		<td class="editform_required_true" style="height: 30px"></td>
		<td class="editform_control" style="height: 30px">
            <asp:DropDownList ID="ddlRepairType" runat="server">
                <asp:ListItem>检修</asp:ListItem>
                <asp:ListItem>大修</asp:ListItem>
                <asp:ListItem>特殊修理</asp:ListItem>
                <asp:ListItem>延寿</asp:ListItem>
                <asp:ListItem>待定</asp:ListItem>
                <asp:ListItem>翻新</asp:ListItem>
            </asp:DropDownList>
        </td>
		<td class="editform_label" style="height: 30px">导弹型号</td>
		<td class="editform_required_true" style="height: 30px"></td>
		<td class="editform_control" style="height: 30px">
            <asp:DropDownList ID="ddlMissileModel" runat="server" AutoPostBack="True" 
                onselectedindexchanged="ddlMissileModel_SelectedIndexChanged"></asp:DropDownList>
        </td>
	</tr>
	<tr>
		<td class="editform_label">计划完成时间</td>
		<td class="editform_required_true"></td>
		<td class="editform_control">
             <asp:TextBox ID="txtPlanCompletionDate" runat="server" onClick="WdatePicker()"></asp:TextBox>
             <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" Display="Dynamic" 
                    ControlToValidate="txtPlanCompletionDate" ForeColor="Red">必须填写</asp:RequiredFieldValidator>
        </td>
		<td class="editform_label">下达状态</td>
		<td class="editform_required_false"></td>
		<td class="editform_control">
            <asp:TextBox ID="txtIssueState" runat="server" Enabled="false"></asp:TextBox>
        </td>
	</tr>
    <tr>
        <td class="editform_label">备注</td>
		<td class="editform_required_false"></td>
		<td class="editform_control">
            <asp:TextBox ID="txtRemark" runat="server" TextMode="MultiLine" Height="90px" ></asp:TextBox>
        </td>
		<td class="editform_label">下发车间</td>
		<td class="editform_required_false"></td>
		<td class="editform_control">
            <asp:ListBox ID="lstBoxIssueWorkShop" runat="server" Height="100px"></asp:ListBox>
        </td>
		
	</tr>
    <tr>
		<td class="editform_itemtitle" colspan="6" style="text-align:right; padding-right:5px;">
            <asp:Button ID="btnOK" runat="server" Text="保存派工单信息" onclick="btnOK_Click" ></asp:Button>
            <asp:Button ID="btnCancel" runat="server" Text="返回" onclick="btnCancel_Click" CausesValidation="False" ></asp:Button>
            <asp:Button ID="btnIssue" runat="server" Text="下达" onclick="btnIssue_Click" ></asp:Button>
            <asp:Button ID="btnDispatchCompleted" runat="server" Text="完工" OnClientClick="return confirm('您确定将该派工单设置为已完工吗？');"
                onclick="btnDispatchCompleted_Click" ></asp:Button>
            <asp:Button ID="btnMissileSelect" runat="server" Text="选择导弹" CausesValidation="False" onclick="btnMissileSelect_Click"/>
        </td>		
	</tr>
    <tr>
		<td colspan="6" style="vertical-align:top;">
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="4" Font-Size="9pt" ForeColor="#333333" GridLines="Both"
                    Width="100%" AllowPaging="True" DataKeyNames="DispatchMissileID, MissileCode,MissileModel,InDate,RemainingLife" onpageindexchanging="GridView1_PageIndexChanging" onrowcommand="GridView1_RowCommand" 
                        onrowdatabound="GridView1_RowDataBound">            
                    <Columns>
                        <asp:BoundField HeaderText="导弹型号" DataField="MissileModel"/>
                        <asp:BoundField HeaderText="弹号" DataField="MissileCode"/>
                        <asp:BoundField HeaderText="入场时间" DataFormatString="{0:d}" DataField="InDate"/>
                        <asp:BoundField HeaderText="剩余寿命" DataField="RemainingLife"/>
                        <asp:BoundField HeaderText="是否完工" DataField="IsCompleted"/>
                        <asp:BoundField HeaderText="完工时间" DataField="CompletionDate"/>                
                        <asp:TemplateField HeaderText="操作" ItemStyle-Width="220px">
                            <ItemTemplate>
                                <asp:Button ID="btnArriveShow" runat="server" Text="入场信息" Height="18px"></asp:Button>
                                <asp:Button ID="btnExchange" runat="server" Text="串件" Height="18px"></asp:Button>
                                <asp:Button ID="btnWastage" runat="server" Text="损耗"  Height="18px"></asp:Button>
                                <asp:Button ID="btnProcess" runat="server" Text="工序" CommandName="process" CommandArgument='<%# Eval("DispatchMissileID") %>' Height="18px"></asp:Button>
                                <asp:Button ID="btnCompleted" runat="server" Text="完成" OnClientClick="return confirm('您确定完成吗？');" CommandName="complete" CommandArgument='<%# Eval("DispatchMissileID") %>' Height="18px"></asp:Button>
                                <asp:Button ID="btnDelete" runat="server" Text="删除" OnClientClick="return confirm('您确定要删除该记录吗？');" CommandName="del"  CommandArgument='<%# Eval("DispatchMissileID") %>' Height="18px"></asp:Button>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle BackColor="#DFE8F6" Font-Bold="True" ForeColor="#333333" Height="20px"/>    
                    <RowStyle BackColor="#FAFAFA" ForeColor="#333333" Height="20px" HorizontalAlign="Center"/>
                    <EmptyDataTemplate>
                        <div style="text-align:center; margin-top:20px; margin-bottom:20px;">没有已选择的导弹数据。</div>        
                    </EmptyDataTemplate>
                </asp:GridView>
        </td>		
	</tr>
</table>
</div>
</form>
</body>
</html>
